﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Yxinmt.Entity
{
    public class UserInfo
    {
        public Guid UserId { get; set; }
        public string LastLoginDate { get; set; }
        public string Serial { get; set; }

        public string MeetingRoomId { get; set; }

        public int DisplayIndex { get; set; }

        public string LoginId { get; set; }

        public string MacAddress { get; set; }

        public string SystemName { get; set; }

        public int DeviceType { get; set; }

        public string PushUrl {  get; set; }

        public string CompanyName { get; set; }

        public string FileFormat { get; set; }

        public string VideoFormat { get; set; }

        public byte IsPresident { get; set; }

        public string VersionTime { get; set; }

        List<string> _FileFormatList;
    
        public List<string> FileFormatList
        {
            get
            {
                if(_FileFormatList == null)
                {
                    var format = FileFormat??string.Empty + VideoFormat??string.Empty;
                    _FileFormatList = format.Split(new char[] { ',', '，', '|' }).Where(s => !string.IsNullOrEmpty(s)).Select(s => "." + s.ToLower()).ToList();
                    _FileFormatList.AddRange(VideoFormatList);
                }
                return _FileFormatList;
            }
            set
            {
                _FileFormatList = value;
            }
        }

        List<string> _VideoFormatList;

        public List<string> VideoFormatList
        {
            get
            {
                if (_VideoFormatList == null)
                {
                    var format = VideoFormat ?? "mp4,mov,avi,mkv,rmvb";
                    _VideoFormatList = format.Split(new char[] { ',', '，', '|' }).Where(s => !string.IsNullOrEmpty(s)).Select(s => "." + s.ToLower()).ToList();
                }
                return _VideoFormatList;
            }
            set
            {
                _VideoFormatList = value;
            }
        }

        public Dictionary<string, object> SendSharingData { get; set; }

        public Dictionary<string,object> ReceSharingData { get; set; }

        public string MeetingRoomName { get; set; }

        public string AdminPassword { get; set; }

        public string Theme { get; set; }

        public bool IsChangeService { get; set; }
    }
}
